home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1074 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  3.8 KB

  1. Path: news1.ucsd.edu!usenet
  2. From: djohnson@tartarus.ucsd.edu (Darin Johnson)
  3. Newsgroups: comp.edu,comp.lang.c,comp.lang.c++
  4. Subject: Re: C or C++ for a 14-year old?
  5. Date: 08 Jan 1996 16:33:02 -0800
  6. Organization: UCSD Computer Science and Engineering Department
  7. Sender: djohnson@tartarus.ucsd.edu
  8. Message-ID: <qq4tu6nr5t.fsf@tartarus.ucsd.edu>
  9. References: <4b30ld$lp2$1@mhafc.production.compuserve.com>
  10.     <w31V7MD4ED1aLz3@dexam.another.gun.de>
  11.     <dschrage.23.152EBB70@indirect.com>
  12.     <4cq6cr$t51@dub-news-svc-1.compuserve.com> <4cqhu3$1quo@news.gate.net>
  13. NNTP-Posting-Host: tartarus.ucsd.edu
  14. In-reply-to: bhutto@gate.net's message of 8 Jan 1996 07:42:59 GMT
  15. X-Newsreader: Gnus v5.0
  16.  
  17. bhutto@gate.net (William Hutto) writes:
  18. > 10 FOR I=1 TO 10
  19. > 20 PRINT "YOUR NAME HERE"
  20. > 30 NEXT I
  21. > 40 END
  22. > RUN
  23.  
  24. That's much of the problem with BASIC.  More modern BASIC's are
  25. better than this, why go back to the 70's way of doing things?
  26. You don't need a label on every line.  It just makes things
  27. harder (renumber is a kluge to get around a bad feature).
  28.  
  29. What about
  30.  
  31.     For I=1 to 10
  32.     print "your name here"
  33.     next i
  34.     end
  35.  
  36. With no labels.  Or better yet, forget the wierd for statment
  37. (that was very hard for me to grasp when I first saw it, because
  38. first I kept trying to fit the English meaning of the words into
  39. place, and second, it wasn't explained that this was just a shortcut
  40. for a while statement)
  41.  
  42. Personally, I think it's just as easy for a beginner to understand
  43.  
  44.    i = 1
  45.    while i <= 10
  46.       print "your name here"
  47.    done
  48.  
  49. Not only is it easy to understand, you start to see statements in
  50. terms of groups of statements, not a sequential list.  You start
  51. to see programs as a hierarchical structure, not a flowchart.
  52. And when you get to BASIC programs of over 50 lines, things get
  53. ugly *fast*.  Why should the beginner struggle deciphering a few
  54. pages of BASIC code, when they could breeze through the same amount
  55. if it were written in a Pascal like language?
  56.  
  57. [C program removed]
  58. >     This *program* requires considerably more explanation. Also, if this 
  59. > is not a C *interpreter* the student needs to know something about compilation 
  60. > and may even need to know about files and linking.
  61.  
  62. Yes, C isn't so great for the beginner.  Elementary Pascal programs
  63. aren't so bad.  There's a little preamble, but simpler than C, and
  64. far fewer "just do it that way, I'll explain later".
  65.  
  66. >     The ultimate *destination* might be a commonly used/accepted language. 
  67. > I went from BASIC to 6502 assembly language, 8086 assembly language, C, C++ 
  68. > and then Pascal. When I got to Pascal I thought, "Oops, wrong way!" 
  69. >     I almost wanted to say, start with assembler.
  70.  
  71. First thing I did was Cardiac - a cardboard instructional aid to
  72. computers (yeah right, no one had computers back then, at least no in
  73. hick towns).  Then something that had relays and such, looking a lot
  74. like a sturdy version of the radioshack electronics kits.  Then I got
  75. access to a real computer, and did a bit of assembler.  Then I looked
  76. over at the TSR machine next to the Altair and said, hey, that's a lot
  77. simpler, and I don't have to punch in a bunch of bootup code either
  78. :-) Then I did a bunch of basic, hurting my head trying to decipher
  79. the long programs.
  80.  
  81. Then I saw Pascal in college, and for the first time, I related
  82. programs to math, and things were elegant, not a jumble of code.
  83. Things were abstract, not tied to the nuts and bolts of the machine.
  84. It was just so vastly different from the way I had looked at things
  85. before.  You could actually write huge programs and be able to
  86. understand it for once.  So maybe, there's still a little bit of me
  87. that thinks the beginner should do things the hard way, just to get a
  88. better appreciation of high level languages (and then I wise up and
  89. realize that the lesson would be lost on 90% of the them).
  90. -- 
  91. Darin Johnson
  92. djohnson@ucsd.edu --  Strange things are afoot at the circle-K...
  93.